Only send the OFFLINE hotplug event if be->netif is set. Firstly, this ensures
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 21 Mar 2006 11:25:23 +0000 (12:25 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 21 Mar 2006 11:25:23 +0000 (12:25 +0100)
that OFFLINE is only sent if the ONLINE event has been sent.  Secondly, this
fixes one possible cause of the reopened bug #549 as it prevents be->netif
being dereferenced inside netback_uevent.  Early reports suggest that this is
not the only cause of #549, so that bug remains open for now.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c

index 526e02ab0ab3b228b38db227b9587e9c1b58d3a4..52a4fc98c8edccd86b7b28dece9b85141bd9d661 100644 (file)
@@ -213,7 +213,8 @@ static void frontend_changed(struct xenbus_device *dev,
                break;
 
        case XenbusStateClosed:
-               kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
+               if (be->netif != NULL)
+                       kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
                device_unregister(&dev->dev);
                break;